package com.atguigu.springcloud.service.impl;

import com.atguigu.springcloud.service.FeignService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.stereotype.Component;

@Component
public class FeignServiceImpl implements FeignService {
    @Override
    @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "5000")
    public String getPaymentInfo_OK(Integer id) {
        return "FeignServiceImpl to tell you : 服务器异常，请稍后再试";
    }

    @Override
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "5000")
    })
    public String getPaymentInfo_Timeout(Integer id) {
        return "FeignServiceImpl to tell you : 服务器异常，请稍后再试";
    }
}
